home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGSCAL / TBUTIL2.LZH / BIOSREAD.INC < prev    next >
Text File  |  1984-07-13  |  1KB  |  46 lines

  1.  
  2. PROCEDURE biosread(VAR bx;dl:BYTE;dh:BYTE;ch:BYTE;cl:BYTE;al:BYTE);
  3. {
  4.            JUNE 28, 1984
  5.  
  6.            Author:       Todd Little
  7.                          1318 Bullock
  8.                          Houston, TX  77055
  9.                          713-984-2055 h
  10.                              578-3210 w
  11.  
  12. }
  13.  
  14.  
  15. {    This procedure allows a read on any diskette or hard disk sector
  16.      using the bios interrupt 13h.
  17.  
  18.      The drive number is loaded in dl: 0,1,2,3  = a:,b:,c:,d: for diskettes,
  19.                                        80H      = c:          for hard disk
  20.  
  21.      The side, track (cylinder), and sector are loaded in:   dh,ch,cl
  22.  
  23.      The number of sectors to read is passed in  al
  24.  
  25.      The data will be read into the storage location passed as bx
  26.  
  27. }
  28.  
  29.  
  30. BEGIN
  31.  
  32.    INLINE
  33.   (   $8b/$5e/$10/    {mov bx,[bp+10]    load the segment of 'bx'}
  34.       $8e/$c3/        {mov es,bx         establish segment address}
  35.       $8b/$5e/$0e/    {mov bx,[bp+0e]    bx:    where the data goes}
  36.       $8a/$56/$0c/    {mov dl,[bp+0c]    dl:    drive number   }
  37.       $8a/$76/$0a/    {mov dh,[bp+0a]    dh     side}
  38.       $8a/$6e/$08/    {mov ch,[bp+08]    ch     track}
  39.       $8a/$4e/$06/    {mov cl,[bp+06]    cl     sector}
  40.       $8a/$46/$04/    {mov al,[bp+04]    al:    number of sectors to read}
  41.       $b4/$02/        {mov ah,02         do a 'bios read'}
  42.       $cd/$13         {int 13h}
  43.          )
  44.  
  45. END;
  46.